<?

	session_start();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xpert tag results</title>
<style>

	html{
	
		margin:0px;
		padding:0px;
		font-family:Verdana, Arial, Helvetica, sans-serif;
	
	}
	
	body{
	
		margin:0px;
		padding:0px;
	
	}
	
	.top_wrapper{

		width:100%; 
		background-color:#F9F9F9; 
		height:44px
	
	}
	
	.text_centre{
		
		width:950px; 
		margin:0 auto; 
		text-align:center;
	
	}
	
	.top_left{
	
		width:500px; 
		float:left; 
		position:relative; 
		text-align:left; 
		font-size:80%; 
		font-weight:bold; 
		color:#434343; 
		padding-top:12px;
	
	}
	
	.top_left span{
		
		border-left:1px solid #D6D6D6; 
		padding:0 10px
	
	}
	
	.top_left span a, .top_right span a{
	
		color:#434343;
		
	}
	
	.top_right{
	
		width:450px; 
		float:right; 
		position:relative; 
		height:100%; 
		text-align:left; 
		font-size:80%; 
		font-weight:bold; 
		color:#434343; 
		padding-top:12px;
	
	}
	
	.top_right span{
		
		border-left:1px solid #D6D6D6; 
		padding:0 10px;
		
	}
	
	.main_wrapper{
	
		float:left; 
		position:relative; 
		width:100%; 
		text-align:center;
	
	}
	
	.page_holder{
	
		width:900px; 
		text-align:left; 
		margin:0 auto; 
		height:100px;
	
	}
	
	.logo{
		
		float:left; 
		position:relative; 
		height:100px; 
		width:149px;
	
	}
	
	.contributors{
	
		float:left; 
		position:relative; 
		height:500px; 
		width:100%; 
		background-color:#FFFFFF;  
		margin-top:20px; 
		text-align:center
	
	}
	
	.contributors a{
	
		color:#7C7C7C; 
		text-decoration:none;
	
	}

	.index_holder{
	
		width:950px; 
		margin:0 auto; 
		text-align:center;
	
	}
	
	.index_left{
	
		width:500px; 
		float:left; 
		position:relative; 
		height:500px; 
		background-color:#FFFFFF; 
		text-align:center;
	
	}
	
	.index_left p{
	
		font-size:80%; 
		font-weight:bold; 
		margin-top:40px;
	
	}
	
	.index_left p a{
	
		color:#434343;
	
	}
	
	.tag_cloud{
	
		width:450px; 
		float:left; 
		position:relative; 
		height:500px; 
		text-align:left
	
	}
	
	.tag_cloud p{
	
		color:#9C8A5A; 
		font-weight:bold; 
		font-size:110%; 
		padding-top:38px;
	
	}
	
	.submit_centre{
	
		width:900px; 
		text-align:left; 
		margin:0 auto; 
		height:100px;
		
	}
	
	.top_search_box{
	
		float:left; 
		position:relative; 
		margin-left:20px;
		
	}
	
	.top_search_box p{
	
		font-size:75%; 
		font-weight:bold;
	
	}
	
	.top_search_box p a{
	
		color:#434343;
	
	}
	
	.results_holder{
	
		width:900px; 
		text-align:left; 
		margin:0 auto; 
		clear:left; 
		border-top:1px solid #D2c598; 
		color:#665723; 
		font-weight:bold; 
		height:20px; 
		padding-top:10px; 
		margin-bottom:25px;
	
	}
	
	.pages{
	
		float:right; 
		font-size:80%; 
		color:#333;	
		
	}
	
	.pages span, .pages span a{
	
		color:#665723;
	
	}
	
	.button_bar_index{
	
		float:left; 
		position:relative; 
		width:100%; 
		height:30px; 
		font-weight:bold; 
		background-color:#F5F5F5; 
		font-size:80%;
	
	}
	
	.license{
	
		float:left; 
		position:relative; 
		width:150px; 
		padding:5px; 
		color:#766B2B; 
		background-color:#DAD7D2; 
		text-align:center;  
		margin-right:5px; 
		cursor:hand; 
		cursor:pointer;
				
	}
	
	.related{
	
		float:left; 
		position:relative; 
		background-color:#A9A9A9; 
		width:150px; 
		padding:5px; 
		text-align:center; 
		margin-right:5px; 
		cursor:hand; 
		cursor:pointer;
	
	}
	
	.recommend{
	
		float:left; 
		position:relative; 
		background-color:#A9A9A9; 
		width:150px; 
		padding:5px; 
		text-align:center;  
		margin-right:5px; 
		cursor:hand; 
		cursor:pointer;
	
	}
	
	.tab_holder{
	
		background-color:#F5F5F5; 
		font-size:80%; 
		width:100%
		
	}
	
	.relation{
	
		border-top:1px solid #655723; 
		margin:10px; 
		padding:10px; 
		display:none;
	
	}
	
	.recommender{
	
		border-top:1px solid #655723; 
		margin:10px; 
		padding:10px; 
		display:none
	
	}
	
	.browse_holder{
	
		width:900px; 
		text-align:left; 
		margin:0 auto; 
		clear:left; 
		border-top:1px solid #D2c598; 
		color:#665723; 
		font-weight:bold; 
		height:20px; 
		padding-top:10px; 
		padding-left:20px; 
		margin-bottom:25px;
	
	}
	
	.lower_browse_holder{
	
		width:850px; 
		text-align:left; 
		color:#665723; 
		padding-top:10px; 
		margin-bottom:25px;
	
	}
	
	.left_form{
	
		width:440px; 
		float:left; 
		position:relative; 
		color:#000;  
		margin-bottom:25px; 
		font-weight:bold;
	
	}
	
	.right_form{
	
		width:440px; 
		float:left; 
		position:relative; 
		color:#000;  
		margin-bottom:25px; 
		font-weight:bold;
	
	}

</style>
<script language="javascript" type="text/javascript" src="display_and_email.js"></script>
</head>
<body>
	<div class="top_wrapper">
		<div class="text_centre">
			<div class="top_left">
				<span>  
					<a href="http://www.nottingham.ac.uk/xpert/">Back to main page</a>  
				</span>
			</div>
			<div class="top_right">
						<span>  <a href="feedsubmit.php">Submit a link</a>  </span><span>  <a href="rss.php">Subscribe to RSS</a>  </span><span><a href="about.php">About</a></span><span><a href="contributors.php">Contributors</a></span>
			</div>
		</div>
	</div>
	<div class="main_wrapper">
		<div class="page_holder">
			<div class="logo">
				<img src="http://www.nottingham.ac.uk/xpert/images/logoresults.gif" />
			</div>
			<div class="top_search_box" style="margin-top:10px">
				<p>
					<a href="advancedsearch.php">Advanced search</a> | <a href="browse.php">Browse Resources</a>
				</p>	
			</div>
		<div class="browse_holder" style="font-weight:normal">
			<div style="float:left; margin-bottom:20px; font-weight:bold">Tag results</div>
<?

	function is_not_to_be_found($var){
	
		if(strpos($var,"-")===0){
		
			return true;
		
		}else{
		
			return false;
		
		}
	
	}

	include "xpert_database.php";
	
	xpert_database_connect($xpert_site);
	
	xpert_database_select($xpert_site);
		
	///
	///
	/// KEYWORDS
	///
	///
	///
	
	$query = "select * from xpert_core_subject where resource_subject LIKE (\"" . $_GET['tag'] . "\")";
			
	$site_questions = xpert_database_multiple_select_query($query, $xpert_site);

	while($site_questions_object = xpert_database_fetch_object_from_response($site_questions)){
		
			if(!isset($results_object_array[$site_questions_object->resource_id])){
			
				$results_object_array[$site_questions_object->resource_id] = $site_questions_object;
			
			}

	}
	
	/////////////////////////
	
	/////////////////////////
			
	echo "<div style=\"width:900px; text-align:left; margin:0 auto; clear:left; padding-left:20px; margin-top:20px;\">";
		
	while($result = array_pop($results_object_array)){
		
    //for($y=0;$y<count($results_object_array);$y++){
		$index = $result->resource_id;	
	
		$query = "select * from xpert_core_scratch where resource_id = " . $index;
		
			$response = xpert_database_select_query($query,$xpert_site);
		
			$query = "select * from xpert_core_description where resource_id = " . $index;
		
			$response_desc = xpert_database_select_query($query,$xpert_site);
	
			echo "<p style=\"text-align:left\"><a style=\"color:#2E1D8F\" target=\"new\" href=\"" . $response->resource_link . "\">" . $response->resource_title . "</a><Br><span style=\"font-size:80%; color:#333\">  " . $response_desc->resource_description . "</span><br><span style=\"font-size:80%; font-weight:bold; color:#7A6A37;\">Author(s): </span><span style=\"font-size:80%;\">";
		
			$query = "select * from xpert_core_creator where resource_id = " . $index;
		
			$response = xpert_database_multiple_select_query($query,$xpert_site);
		
			while($author = xpert_database_fetch_object_from_response($response)){
		
				echo utf8_encode($author->resource_creator);

			}
		
			echo "</span><br></p>";
		
			$query = "select * from xpert_core_rights where resource_id = " . $index;
		
			$response = xpert_database_select_query($query,$xpert_site);
		
			echo "<div id=\"button_bar_$index\" class=\"button_bar_index\">";
		
			echo "<div number=\"$index\" class=\"license\" onClick=\"toggle(this)\">License information</div>";
		
			echo "<div number=\"$index\" class=\"related\" onClick=\"toggle(this)\">Related content</div>";
				
			echo "<div number=\"$index\" class=\"recommend\" onClick=\"toggle(this)\">Recommend</div></div>";
		
			echo "<div class=\"tab_holder\"><p id=\"license_$index\" style=\"border-top:1px solid #655723; margin:10px; padding:10px;\">" . utf8_encode($response->resource_rights) . "</p>";
		
			$query = "select * from xpert_core_relation where resource_id = " . $index;
		
			$response_relation = xpert_database_multiple_select_query($query,$xpert_site);
			
			echo "<p id=\"relation_$index\" class=\"relation\">";
			
			while($relation = xpert_database_fetch_object_from_response($response_relation)){
		
				echo utf8_encode($relation->resource_relation) . "<br> ";

			}
			
			echo "</p>";
		
			echo "<p id=\"reco_$index\" class=\"recommender\"><form number=\"$index\" id=\"form_$index\" action=\"javascript:mail_send($index)\" style=\"margin:0px; padding:0px; display:none\">Your name<input style=\"margin:0 5px\" type=\"text\" size=\"20\" id=\"name_$index\" />Email address to send to<input style=\"margin-left:5px\" id=\"email_$index\" type=\"text\" size=\"40\" /><input type=\"image\" src=\"images/send.gif\" name=\"email_$index\" style=\"vertical-align:middle; margin-left:5px;\"/></form></p></div>";

		}
	
		?>
		</div>
<!-- Start - Webtrends tagging -->
<script type="text/javascript"
src="http://www.nottingham.ac.uk/common/webtrends/sdc-advanced-tracking.
js"></script>
<script type="text/javascript">
//<![CDATA[
	var gDomain = "uiwwwwbt01.ad.nottingham.ac.uk";
	var gDcsId  = "dcsuhohgd10000oiqfkmqufiu_6c8f"; // ]]> </script> <script type="text/javascript"
src="http://www.nottingham.ac.uk/common/webtrends/sdc.js"></script>
<noscript><img alt="" border="0" name="dcsimg" width="1" height="1"
src="http://uiwwwwbt01.ad.nottingham.ac.uk/dcsuhohgd10000oiqfkmqufiu_6c8
f/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.0.0"
/></noscript>
<!-- End - Webtrends tagging -->

</body>
</html>
